<template>
	<view class="v-home-page" :style="{ '--bg-image': `url(${ materialBg})` }">
		<view :style="{ height: navTop + 'px' }"></view>

		<view class="flex-start-center " style="color:#333333" @click="backNav()">

			<uni-icons style="margin-top: 7rpx;" color="#333333" type="left" size="20"></uni-icons>
			<text style="color: 333333;font-size: 33rpx;"> 帮助中心</text>
		</view>
		<view class="margin-top_20rpx">

		</view>
		<!-- <uv-parse class="" :content="richText" :selectable="true" lazy-load></uv-parse> -->

		<!-- 	<video id="myVideo" :src="videoShowUrl"
			:poster="videoShowUrl + '?x-oss-process=video/snapshot,t_1000,f_jpg,m_fast'"
			style="width:755rpx;height: 400rpx;margin-left: -22rpx;margin-top: 30rpx;" @pause="pauseFn">
		</video> -->
		<view class="" >
			<uv-parse class="" :content="richText" :selectable="true" lazy-load></uv-parse>  
			<!-- <image style="width:750rpx;height: 400rpx;" :src="helpCenterBgFive" mode="aspectFill"></image> -->
		</view>
		<view class="" style="margin-top: -54rpx;border-radius: 20rpx 20rpx 0rpx 0rpx;background-color: #fff;width: 750rpx;height: 300rpx;position: relative;
    z-index: 999;">

			<view class="rule-head padding-top_30rpx">
				<view class="line"></view>
				<text class="title">热门问题</text>
				<view class="line"></view>
			</view>

			<view class="flex-align-center classContianer flex-wrap" v-if="recommendList.length">
				<block v-for="(item, index) in recommendList" :key="index">
					<view class="flex-column v-class" @click="goDetail(item.content)">
						<image :src="item.pic_url"></image>
						<text style="font-weight: 700;">{{item.title}}</text>
					</view>
				</block>
			</view>

			<view class="OtherIssues">
				<view class="flex-start-center " style="padding: 30rpx; 20rpx">
					<image class="signImg " style="margin-right: 10rpx;" :src="groupsignFive" mode=""></image>
					<view class="font-weight_bold">
						你可能遇到的其他问题
					</view>

				</view>

				<view v-for="(item,index) in problemList " :key="index" class="flex-between"
					style="padding: 30rpx 30rpx;border-top: 2rpx solid rgba(240, 240, 240, 1); ;"
					@click="goDetail(item.content)">
					{{item.title}}
					<uni-icons style="margin-top: 7rpx;" color="#333333" type="right" size="20"></uni-icons>

				</view>


			</view>


			<!-- <view class="list-public p-bo" @click.stop="updateCheck(index,item)" v-for="(item,index) in helpList" :key="index">
			 	<view class="flex-between ">
			 		<image class="img" :src="fireThree" mode=""></image> 
			 
			 
			 		<view class="flex-between" style="width: 1050rpx;">
			 
			 			<view class="font-size_30rpx ">
			 				{{item.title}}</view>
			 
			 			<view class="right-image">
			 
			 				<image class="right-image-icon" :class=" is_show&&indexTab==item.id  ? '' : 'right-image-icon-c'"
			 					:src="open" mode=""></image>
			 			</view>
			 
			 		</view>
			 	</view>
			 	<view class="flex-start-center margin-top_20rpx" v-if="is_show&&indexTab==item.id">
			 
			 		<view>
			 			<view class="margin-bottom_20rpx">{{item.content}}</view>
			 
			 		</view>
			 	</view>
			 
			 </view> -->

		</view>







	</view>
</template>

<script>
	export default {
		data() {
			return {
				open: this.$imgs.open,
				fireThree: this.$imgs.fireThree,
				indexTab: '',
				is_show: false,
				navTop: '',
				helpCenterBgFive: this.$imgs.helpCenterBgFive,
				groupsignFive: this.$imgs.groupsignFive,
				videoShowUrl: 'https://yunhunjian123.oss-cn-shanghai.aliyuncs.com/1747213524742.mp4',
				helpList: [{
					id: 1,
					title: '标题内容',
					content: '充值对出借人是免费的，手续费由平台承担。充值对出借人是免费的，手续费由平台承担。'


				}, {
					id: 2,
					title: '标题内容',
					content: '充值对出借人是免费的，手续费由平台承担。充值对出借人是免费的，手续费由平台承担。'


				}, {
					id: 3,
					title: '标题内容',
					content: '充值对出借人是免费的，手续费由平台承担。充值对出借人是免费的，手续费由平台承担。'


				}, ],
				richText: '',
				recommendList: [],
				problemList: []


			}
		},
		onLoad() {
			const app = getApp();
			this.navTop = app.globalData.navTop;
			this.helpCenterFn()
			this.problemListFn()


		},
		computed: {


		},
		methods: {
			goDetail(content) {
				this.$sun.navGo('/pages/contactUs/helpDetails?obj=' + encodeURIComponent(
					JSON.stringify(
						content)))
			},

			async problemListFn() {
				const result = await this.$http.get({
					url: this.$api.problemList,

				});
				if (result.errno == 0) {
					console.log(result.data)
					this.recommendList = result.data.recommend

					this.problemList = result.data.problem


				} else {
					this.$sun.toast(result.message, 'none')

				}
			},
			async helpCenterFn() {
				const result = await this.$http.get({
					url: this.$api.system,

				});
				if (result.errno == 0) {
					console.log(result.data)
					// this.$sun.toast(result.message, 'none')

					this.richText = result.data.help_text


				} else {
					this.$sun.toast(result.message, 'none')

				}
			},


			updateCheck(index, item) {
				this.is_show = !this.is_show
				this.indexTab = item.id
			},
			backNav() {
				this.$sun.navBack()
			}

		}
	}
</script>

<style lang="less">
	.v-home-page {

		// background-image: (var(--bg-image));
		background-repeat: no-repeat;
		background-size: cover;
		position: relative;
		height: 100vh;

		// padding: 20rpx;
		.OtherIssues {
			width: 750rpx;
			margin-top: 40rpx;
			background-color: #fff;

			.signImg {
				width: 32rpx;
				height: 32rpx;
			}
		}

		.classContianer {
			background-color: #fff;
			// margin: 30rpx 25rpx 0rpx;
			border-radius: 20rpx;
			// padding-top: 25rpx;
			padding-bottom: 50rpx;


			.v-class {
				width: calc(100% / 4);
				margin-top: 30rpx;



				image {
					// margin-top: 48rpx;
					width: 110rpx;
					height: 110rpx;
				}

				text {
					font-size: 24rpx;
					color: #333333;
					margin-top: 24rpx;
				}
			}
		}

		.list-public {
			width: 710rpx;
			margin: 0;
		}

		.right-image {
			width: 30rpx;
			height: 30rpx;
			position: relative;
			z-index: 3;

			.right-image-icon {
				width: 100%;
				height: 100%;
				transition-property: all;
				transition-duration: .1s;
				transition-timing-function: linear;
				transform: rotate(0);
			}

			.right-image-icon-c {
				transition-property: all;
				transition-duration: .1s;
				transition-timing-function: linear;
				transform: rotate(-90deg);
			}
		}


		.rule-head {
			display: flex;
			justify-content: space-around;
			align-items: center;
			padding-top: 0 20rpx;

			.line {
				flex: 1;
				height: 2rpx;
				background-color: #c5c5c5;
				;
			}

			.title {
				width: 200rpx;
				color: #666666;
				line-height: 70rpx;
				font-size: 30rpx;
				text-align: center;
				margin: 0 20rpx;
				border-radius: 8rpx;

			}
		}


		.right-image {
			width: 30rpx;
			height: 30rpx;
			position: relative;
			z-index: 3;

			.right-image-icon {
				width: 100%;
				height: 100%;
				transition-property: all;
				transition-duration: .1s;
				transition-timing-function: linear;
				transform: rotate(0);
			}

			.right-image-icon-c {
				transition-property: all;
				transition-duration: .1s;
				transition-timing-function: linear;
				transform: rotate(-90deg);
			}
		}

		.img {
			width: 80rpx;
			height: 40rpx;
			border-radius: 50%;
			margin-right: 20rpx;
		}
	}
</style>